# 1-导包
import pymysql

# 2-创建连接，获取连接对象
conn = pymysql.connect(host="211.103.136.244",user="student",password="KDTX_student_202304",
                       port=7068,database="huike",charset='utf8')
# 3-通过连接对象获取游标
cur = conn.cursor()
# 4-通过游标执行SQL
cur.execute("select version();")
# 查看结果
print(cur.fetchall())
# 5-关闭游标
cur.close()
# 6-关闭连接
conn.close()